﻿// See https://aka.ms/new-console-template for more information

using Microsoft.Extensions.Configuration;

namespace LinqProgram;

public static class Program
{
    public static void Main(string[] args)
    {
        var arr1 = new Class1[10];
        var arr2 = new Class2[11];
        for (var i = 0; i < 10; i++)
        {
            arr1[i] = Class1.GetClass1(i);
            arr2[i] = Class2.GetClass2(i + 5);
        }

        IConfiguration configuration = new ConfigurationManager();
        arr2[10] = Class2.GetClass2(10);
        var info = arr1.Join(arr2,
            e => e.Index,
            c => c.Index, 
            (e, c) => new { index = e.Index, index2 = c.Index }).ToList();
        foreach (var item in info)
        {
            Console.WriteLine(item);
        }

        var res = info.Where(e => e.index == 1).ToList();
        foreach (var item in res)
        {
            Console.WriteLine(item);
        }
    }
}